public class Map {
    private static int mapMinX = 100;
    private static int mapMaxX = 700;
    private static int mapMinY = 100;
    private static int mapMaxY = 500;

    public static int getMapMinX() {
        return mapMinX;
    }

    public static int getMapMaxX() {
        return mapMaxX;
    }

    public static int getMapMinY() {
        return mapMinY;
    }

    public static int getMapMaxY() {
        return mapMaxY;
    }

    public Map(int mapMinX, int mapMinY, int mapMaxX, int mapMaxY) {
        this.mapMinX = mapMinX;
        this.mapMinY = mapMinY;
        this.mapMaxX = mapMaxX;
        this.mapMaxY = mapMaxY;
    }
    //0向下 1向上 2向左 3向右
    public static boolean scopeIf(Tank tank) {
        switch (tank.getDirection()) {
            case 0:
                if (tank.getY() +tank.getSpeed() + 100 > mapMaxY ) {
                    return false;
                }
                break;
            case 1:
                if (tank.getY() - tank.getSpeed() - 100< mapMinY) {
                    return false;
                }
                break;
            case 2:
                if (tank.getX() - tank.getSpeed() - 100< mapMinX ) {
                    return false;
                }
                break;
            case 3:
                if (tank.getX() + tank.getSpeed() + 100 > mapMaxX) {
                    return false;
                }
                break;
        }
        return true;
    }
}